/*
 * @Author: 吴世扬 18368095041@163.com
 * @Date: 2024-05-06 23:09:53
 * @LastEditors: 吴世扬 18368095041@163.com
 * @LastEditTime: 2024-05-09 10:45:41
 * @FilePath: /data-center-web-update/src/lang/index.ts
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import { createI18n } from 'vue-i18n';
import { useAppStoreHook } from '@/store/modules/app';
// 本地语言包
import enLocale from './package/en';
import zhCnLocale from './package/zh-cn';

const appStore = useAppStoreHook();

const messages = {
    'zh-cn': {
        ...zhCnLocale
    },
    en: {
        ...enLocale
    }
};

const i18n = createI18n({
    legacy: false,
    locale: appStore.language,
    messages: messages,
    globalInjection: true
});

export default i18n;
